package com.xu.fountain.Entity;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
@Table(name = "fountain_order", schema = "fountain", catalog = "")
public class FountainOrderEntity {
    private int orderid;
    private String ordersn;
    private String paysn;
    private Integer paytype;
    private Integer userid;
    private Double amount;
    private int paystatus;
    private Timestamp losetime;
    private int facilityid;
    private int remove;
    private Timestamp paytime;
    private Timestamp placetime;

    @Id
    @Column(name = "orderid")
    public int getOrderid() {
        return orderid;
    }

    public void setOrderid(int orderid) {
        this.orderid = orderid;
    }

    @Basic
    @Column(name = "ordersn")
    public String getOrdersn() {
        return ordersn;
    }

    public void setOrdersn(String ordersn) {
        this.ordersn = ordersn;
    }

    @Basic
    @Column(name = "paysn")
    public String getPaysn() {
        return paysn;
    }

    public void setPaysn(String paysn) {
        this.paysn = paysn;
    }

    @Basic
    @Column(name = "paytype")
    public Integer getPaytype() {
        return paytype;
    }

    public void setPaytype(Integer paytype) {
        this.paytype = paytype;
    }

    @Basic
    @Column(name = "userid")
    public Integer getUserid() {
        return userid;
    }

    public void setUserid(Integer userid) {
        this.userid = userid;
    }

    @Basic
    @Column(name = "amount")
    public Double getAmount() {
        return amount;
    }

    public void setAmount(Double amount) {
        this.amount = amount;
    }

    @Basic
    @Column(name = "paystatus")
    public int getPaystatus() {
        return paystatus;
    }

    public void setPaystatus(int paystatus) {
        this.paystatus = paystatus;
    }

    @Basic
    @Column(name = "losetime")
    public Timestamp getLosetime() {
        return losetime;
    }

    public void setLosetime(Timestamp losetime) {
        this.losetime = losetime;
    }

    @Basic
    @Column(name = "facilityid")
    public int getFacilityid() {
        return facilityid;
    }

    public void setFacilityid(int facilityid) {
        this.facilityid = facilityid;
    }

    @Basic
    @Column(name = "remove")
    public int getRemove() {
        return remove;
    }

    public void setRemove(int remove) {
        this.remove = remove;
    }

    @Basic
    @Column(name = "paytime")
    public Timestamp getPaytime() {
        return paytime;
    }

    public void setPaytime(Timestamp paytime) {
        this.paytime = paytime;
    }

    @Basic
    @Column(name = "placetime")
    public Timestamp getPlacetime() {
        return placetime;
    }

    public void setPlacetime(Timestamp placetime) {
        this.placetime = placetime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        FountainOrderEntity that = (FountainOrderEntity) o;
        return orderid == that.orderid &&
                paystatus == that.paystatus &&
                facilityid == that.facilityid &&
                remove == that.remove &&
                Objects.equals(ordersn, that.ordersn) &&
                Objects.equals(paysn, that.paysn) &&
                Objects.equals(paytype, that.paytype) &&
                Objects.equals(userid, that.userid) &&
                Objects.equals(amount, that.amount) &&
                Objects.equals(losetime, that.losetime) &&
                Objects.equals(paytime, that.paytime) &&
                Objects.equals(placetime, that.placetime);
    }

    @Override
    public int hashCode() {

        return Objects.hash(orderid, ordersn, paysn, paytype, userid, amount, paystatus, losetime, facilityid, remove, paytime, placetime);
    }
}
